import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import PrintData from "@/views/PrintData.vue";
import ConfigPage from "@/views/ConfigPage.vue";
import AfterPrintData from "@/views/AfterPrintData.vue";
import DataRecords from "@/views/DataRecords.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "home",
    redirect: "/data",
  },
  {
    path: "/data",
    name: "data",
    component: DataRecords,
    children: [
      {
        path: "/printData",
        name: "printData",
        component: PrintData,
      },
      {
        path: "/afterData",
        name: "afterData",
        component: AfterPrintData,
      },
    ],
  },
  {
    path: "/config",
    name: "config",
    component: ConfigPage,
  },
  // {
  //   path: "/about",
  //   name: "about",
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: HomeView,
  // },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
